home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
comm2
/
parnet.lha
/
parnet
/
test
/
dump.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-06
|
1KB
|
59 lines
/*
* DUMP.C
*
* TALK addr port
*
* Send massive chatter... 4K packets, displays every 16 packets sent
*/
#include "defs.h"
typedef struct IORequest IOR;
Iob iob;
char Buf[4096];
int
brk(void)
{
return(0);
}
void
main(ac, av)
int ac;
char *av[];
{
PORT *port = CreatePort(NULL, 0);
short i = 0;
onbreak(brk);
iob.io_Message.mn_ReplyPort = port;
iob.io_Addr = atoi(av[1]);
iob.io_Port = atoi(av[2]);
iob.io_Flags= PRO_DGRAM;
if (OpenDevice("parnet.device", 0, (IOR *)&iob, 0)) {
printf("Unable to open parnet.device, error %d %d\n", iob.io_Error, iob.io_Actual);
exit(1);
}
printf("Device $%08lx Unit $%08lx\n", iob.io_Device, iob.io_Unit);
for (;;) {
if (SetSignal(0, SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D|SIGBREAKF_CTRL_E|SIGBREAKF_CTRL_F) & SIGBREAKF_CTRL_E)
break;
iob.io_Command = CMD_WRITE;
iob.io_Data = (APTR)Buf;
iob.io_Length = sizeof(Buf);
DoIO((IOR *)&iob);
++i;
if ((i & 15) == 0)
printf("%4ldK\n", i * sizeof(Buf) / 1024);
}
CloseDevice((IOR *)&iob);
DeletePort(port);
}